Skip to content

fix build warning for GH-16228 #16250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Oct 5, 2024

No description provided.

@@ -28,7 +28,7 @@ static void _cal_easter(INTERNAL_FUNCTION_PARAMETERS, bool gm)
struct tm te;
zend_long year, golden, solar, lunar, pfm, dom, tmp, easter, result;
zend_long method = CAL_EASTER_DEFAULT;
const zend_long max_year = ZEND_LONG_MAX / 1.25;
const zend_long max_year = (zend_long)((double)ZEND_LONG_MAX / 1.25);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

Suggested change
const zend_long max_year = (zend_long)((double)ZEND_LONG_MAX / 1.25);
const zend_long max_year = (ZEND_LONG_MAX / 5) * 4;

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the cast to zend_long is necessary, but it doesn't really hurt.

@devnexen devnexen closed this in 6d9903f Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants